import time

import pytest
from selenium import webdriver

from .table import Table
from ...common.ui.Selector import Selector
from ...exception.TestException import TestException


def test_table_antd3x():
    browser = webdriver.Chrome()
    browser.maximize_window()
    browser.get("https://3x.ant.design/components/table-cn/")

    # 基本
    table = Table(browser,
                  '//section[@id="components-table-demo-row-selection"]//div[@class="ant-table-content"]',
                  Selector.XPATH)
    table.select('Name', 'Joe Black')
    table.select('2', 'Jim Green')
    table.checkValue('Name', 'John Brown')
    with pytest.raises(TestException):
        table.checkValue('Name', 'james')
    time.sleep(10)



